﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace DevelopTools.UI
{
    //UI旋转控制
    public class UIRotEffect : MonoBehaviour
    {
        /// <summary>
        /// UI速度
        /// </summary>
        private float speed;
        /// <summary>
        /// UI旋转方向
        /// </summary>
        public int direct = 1;
        /// <summary>
        /// 正常速度
        /// </summary>
        public float normalSpeed = 10;
        /// <summary>
        /// 加速的倍数
        /// </summary>
        public float multipleSpeed = 10;
        // Use this for initialization
        void Start()
        {
            speed = normalSpeed;
        }

        // Update is called once per frame
        void Update()
        {
            transform.Rotate(Vector3.forward * direct, speed * Time.deltaTime);
        }
        /// <summary>
        /// 加速旋转
        /// </summary>
        public void SetFast()
        {
            speed = normalSpeed * multipleSpeed;
        }
        /// <summary>
        /// 原速旋转
        /// </summary>
        public void SetNomal()
        {
            speed = normalSpeed;
        }
    }

}